import { createI18n } from 'vue-i18n'
import { useLocaleStore } from '@/stores/locale'
import store from '@/stores/index'
import zhCN from './zh-CN.json'
import enUS from './en-US.json'

const { locale } = useLocaleStore(store)

const messages = {
  zh: zhCN,
  en: enUS,
}
console.log('locale', locale)

const i18n = createI18n({
  legacy: false, // 设置为 false 以支持 Composition API
  locale: locale,
  messages,
})

export default i18n
